public class one {
    public static void main(String[] args) {

        for(int i = 100;i < 1000;i ++ ) {
            int sum = 0, t = i;
            while (t != 0) {
                sum += (t % 10) * (t % 10) * (t % 10);
                t /= 10;
            }
            if (sum == i) {
                System.out.println(i);
            }
        }


    }
}
